package com.aim.analysis.test;

import com.aim.analysis.records.Game;
import com.aim.analysis.records.GameMap;
import com.aim.analysis.records.Hit;
import com.aim.analysis.records.HitList;
import com.aim.azure.AzureConnection;
import com.aim.matlab.MatlabUtil;
import com.google.gson.Gson;
import junit.framework.TestCase;

import java.io.File;
import java.io.FileWriter;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.List;

/**
 * User: Avraham Shvartzon
 * Date: 6/24/14
 */
public class HitScripts extends TestCase{

    private static final File jsonRootFolder = new File("C:\\Users\\User\\IdeaProjects\\javaMatlab64\\data\\json");
    private static File hitsJsonFile = new File(jsonRootFolder, "16-19.json");

    public void testToJson() throws Exception {
        AzureConnection azureConnection = new AzureConnection();
        azureConnection.connect();
        azureConnection.addExperimentDate("20140616");
        //azureConnection.addExperimentDate("Test");

        GameMap gameMap = new GameMap();
        List<Hit> hits = Hit.createHits(gameMap, azureConnection);
        HitList hitList = new HitList(hits);
        Gson gson = new Gson();
        gson.toJson(hits.get(0).gameList.get(0), new FileWriter(hitsJsonFile));
    }
}
